package com.iwayin.web.action.commentditto;

import com.iwayin.core.bo.commentditto.CommentDittoBO;
import com.iwayin.core.dataobject.CommentDittoDO;
import com.iwayin.web.action.BaseAction;
import com.iwayin.web.common.AjaxResult;

public class CommentDittoAction extends BaseAction{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private CommentDittoDO commentDitto;
	private CommentDittoBO commentDittoBO;
	private AjaxResult ajaxResult;
	
	/**
	 * @description 添加评论同意观点
	 * @author ZhangLei
	 * @return
	 */
	public String addCommentDitto(){
		try{
			commentDitto.setUserId(this.getLoginUser().getId());
			this.commentDittoBO.addCommentDitto(commentDitto);
			ajaxResult=AjaxResult.succResult();
		}
		catch(Exception e){
			ajaxResult=AjaxResult.errorResult("系统繁忙");
		}
		return SUCCESS;
	}
	
	/**
	 * @description 取消评论同意观点
	 * @author ZhangLei
	 * @return
	 */
	public String deleteCommentDitto(){
		try{
			commentDitto.setUserId(this.getLoginUser().getId());
			this.commentDittoBO.deleteCommentDitto(commentDitto);
			ajaxResult=AjaxResult.succResult();
		}
		catch(Exception e){
			ajaxResult=AjaxResult.errorResult("系统繁忙");
		}
		return SUCCESS;
	}
	
	public CommentDittoDO getCommentDitto() {
		return commentDitto;
	}
	public void setCommentDitto(CommentDittoDO commentDitto) {
		this.commentDitto = commentDitto;
	}
	
	public AjaxResult getAjaxResult() {
		return ajaxResult;
	}
	public void setAjaxResult(AjaxResult ajaxResult) {
		this.ajaxResult = ajaxResult;
	}
	public void setCommentDittoBO(CommentDittoBO commentDittoBO) {
		this.commentDittoBO = commentDittoBO;
	}
	
	
}
